//类中使用构造函数
// class People {
//   public name: string;
//   constructor(name: string) {
//     this.name = name;
//   }
// }
//简化构造函数
class People {
  constructor(public name: string) {}
}
class Boy extends People {
  constructor(public age: number) {
    //子类构造函数必须实现父类构造函数,加上super
    super("wk");
  }
}
// const person11 = new People("wk");
const person11 = new Boy(18);
console.log(person11.name);
console.log(person11.age);
